package it.polimi.travelDream.ejb.beans;

import it.polimi.travelDream.ejb.Cthulhu.Persistenza;
import it.polimi.travelDream.ejb.interfaces.InvitationMgrRemote;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;

import it.polimi.travelDream.entities.Invitation;
import it.polimi.travelDream.entities.Package;

import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
/**
 * Session Bean implementation class InvitationMgr
 */
@Stateless
@LocalBean
public class InvitationMgr implements InvitationMgrRemote {

	Invitation invitation;
	Persistenza persist=new Persistenza();
	public EntityManagerFactory factory;
	public EntityManager em;
	
    public Invitation getInvitation() {
		return invitation;
	}

	public void setInvitation(Invitation invitation) {
		this.invitation = invitation;
	}

	/**
     * Default constructor. 
     */
    public InvitationMgr() {
        // TODO Auto-generated constructor stub
    }
	
	
	@Override
	public Invitation addInvitation(Invitation invitation) {	
			persist.persista(invitation);
			return invitation;	
		}

}
